<%@ page language="java"  pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>管理员密码修改</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="<%=basePath%>scripts/jquery-1.4.2.js"></script>
	<script type="text/javascript">
	   var  basePath="<%=basePath%>";
	 function    checkpassword(){
	  
        String.prototype.trim=function(){
          return this.replace(/(^\s*)|(\s*$)/g, "");
        }
        var newPassword=document.getElementById("newpass").value;
        var  newValue=newPassword.trim();
        if(newValue==""){
        alert("新密码为空");
        
        return ;
        }
        if(newValue.length>8){
     	   alert("长度不能大于8");
            return ;
       } 
         
         var url1 =basePath+"adminloign/updatePass.shtml";
               $.ajax({
                    url: url1,
                    cache: false,
                    data: "newPassword="+newValue,
                    success: function(msg){
                         
                        var obj=eval('('+msg+')');
                        var result=obj[0]["message"];
                        
                      if(result=="0"){
                         alert("密码修改失败");
                         
                      }
                      if(result=="1"){
                         alert("密码修改成功");
                      }
                      
                 }
                });
      }
     
    
    
	</script>
    <LINK href="resource/css/admin.css" type="text/css" rel="stylesheet">
  </head>
  
  <body>
  <div  align="center">
    
         旧密码： <input name="password" value="${adminUser.password}" readonly="readonly" size="8"/><br>
         新密码： <input  name="newPassword"  id="newpass" size="8"/><br>
        <input type="button" onclick="checkpassword()"  value="修改"/>&nbsp;&nbsp;<input type="reset" value="重置"/>
    
   </div>
  </body>
</html>
